import { computed, ref, reactive } from 'vue';
import { Pagination } from '@/types/global';
import type {
  TableColumnData,
  TableData,
} from '@arco-design/web-vue/es/table/interface';

const fmodel: any = {
  applicationId: 100,
  dictionaryCode: '',
  dictionaryName: '',
  dictionaryGroup: '',
};

export const formModel = ref(fmodel);
export const rowSelection = reactive({
  type: 'radio',
  showCheckedAll: false,
  checkStrictly: false, 
});

export const pagination: Pagination = reactive({
  current: 1,
  pageSize: 20,
});

export const columns = computed<TableColumnData[]>(() => [
  {
    title: '编号',
    dataIndex: 'dictionaryId',
  },
  {
    title: '字典代码',
    dataIndex: 'dictionaryCode',
  },
  {
    title: '字典名称',
    dataIndex: 'dictionaryName',
  },
  {
    title: '字典分组',
    dataIndex: 'dictionaryGroup',
  },
  {
    title: '创建时间',
    dataIndex: 'time',
  },
  {
    title: '创建人',
    dataIndex: 'creatorName',
  },
  {
    title: '是否可用',
    dataIndex: 'enabled',
    slotName: 'enable',
  },
  {
    title: '操作',
    slotName: 'operations',
    width: 110,
    align: 'center',
  },
]);
